package solution.T0125_2_DessertShop.tax;

public class FixedProportionalTaxCalculator implements TaxCalculator {

    private final double fixedTax;
    private final double taxProp;

    public FixedProportionalTaxCalculator(double fixedTax, double taxProp) {
        this.fixedTax = fixedTax;
        this.taxProp = taxProp;
    }

    @Override
    public double calculate(double income) {
        if (income == 0) {
            return 0;
        }
        return fixedTax + income * taxProp / 100;
    }
}
